import random

# Optional format of the constructor for the OOP approach
class Player:
    def __init__(self):
        self.food = 0
        self.repu = 0
        self.p    = 1

    # All the other functions are the same as with the non object oriented setting (but they
    # should be instance methods so don't forget to add 'self' as an extra first argument).

    def hunt_choices(self, round_number, current_food, current_reputation, m,
            player_reputations):
        p            = len(player_reputations) + 1
        #self.p      = p
        #self.food   = current_food
        #self.repu   = current_reputation
        
        if round_number == 1:
            hunt_decisions = [ hunt_with(0.8) for x in player_reputations]
            return hunt_decisions
        if current_food < 2.5*(p-1):
            hunt_decisions = ['s' for x in player_reputations]
            return hunt_decisions
        
        #hunts_in_round = 0
        hunt_decisions = [ hunt_with(x) for x in player_reputations]
        return hunt_decisions

    def hunt_outcomes(self, food_earnings):
        pass # do nothing

    def round_end(self, award, m, number_hunters):
        pass # do nothing

def hunt_with(p):
    choice = 'h' if random.random() < p else 's'
    return choice